﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="QuanLyTin.ascx.cs" Inherits="QuanTri_QuanTriTin_QuanLyTin" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<style type="text/css">
    .style1
    {
        color: #0000FF;
        font-weight: bold;
    }
</style>
<center>
    <asp:Panel ID="pnGridDetail" runat="server" Width="700px">
        <span class="BigLabel2">QUẢN LÝ TIN - BÀI VIẾT</span><br />
        Mục tin:
        <asp:DropDownList ID="cboNhomTin" runat="server" AutoPostBack="True" 
            DataTextField="Name" DataValueField="Id" Width="165px" 
            onselectedindexchanged="cboNhomTin_SelectedIndexChanged">
            <asp:ListItem Text="- Tất cả -" Value="-1"></asp:ListItem>
        </asp:DropDownList>
        &nbsp;Trạng thái:
        <asp:DropDownList AutoPostBack="True" ID="cboActive" runat="server" DataTextField="Name" 
            DataValueField="Id" Width="165px" 
            onselectedindexchanged="cboActive_SelectedIndexChanged">
            <asp:ListItem Text="- Tất cả -" Value="-1"></asp:ListItem>
            <asp:ListItem Text="Active" Value="1"></asp:ListItem>
            <asp:ListItem Text="Inactive" Value="0"></asp:ListItem>
        </asp:DropDownList>
&nbsp;
        <asp:Button runat="server" ID="cmdSearch" Text="Tìm kiếm" 
            onclick="cmdSearch_Click" />
        <asp:SqlDataSource ID="dsNhomHangLoc" runat="server" ConnectionString="<%$ ConnectionStrings:DBConnectionString %>"
            ProviderName="<%$ ConnectionStrings:DBConnectionString.ProviderName %>"></asp:SqlDataSource>
        <asp:DataGrid ID="detailGrid" runat="server" AllowPaging="True" AutoGenerateColumns="False"
           Width="100%" PageSize="5" onpageindexchanged="detailGrid_PageIndexChanged" 
            onitemcommand="detailGrid_ItemCommand">
            <PagerStyle Mode="NumericPages" />
            <Columns>
                <asp:BoundColumn Visible="False" HeaderText="NewsId" DataField="NewsId"></asp:BoundColumn>
                <asp:BoundColumn Visible="False" HeaderText="CategoryId" DataField="CategoryId"></asp:BoundColumn>
                <asp:BoundColumn HeaderText="Title" DataField="Title"></asp:BoundColumn>
                <asp:BoundColumn HeaderText="T&#243;m tắt" DataField="Summary"></asp:BoundColumn>
                <asp:BoundColumn HeaderText="Ngày cập nhật" DataField="Createdate" Visible="True"></asp:BoundColumn>
                <asp:TemplateColumn>
                    <ItemTemplate>
                        <asp:Button CausesValidation="False" ID="cmdEdit" runat="server" Text="sửa" Width="40"
                            CommandName="cmdEdit"></asp:Button>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn>
                    <ItemTemplate>
                        <asp:Button CausesValidation="False" ID="cmdDelete" runat="server" Text="Xóa" Width="40"
                            CommandName="cmdDelete" OnClientClick="return confirm('Bạn có chắc muốn xóa tin này?');"></asp:Button>
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
            <HeaderStyle CssClass="HeaderRow" Font-Bold="True" />
        </asp:DataGrid>
        <br />
        <asp:Button runat="server" ID="cmdAddDetail" Text="Thêm mới" 
            onclick="cmdAddDetail_Click" />
        <asp:SqlDataSource ID="dsDetail" runat="server" ConnectionString="<%$ ConnectionStrings:DBConnectionString %>"
            ProviderName="<%$ ConnectionStrings:DBConnectionString.ProviderName %>"></asp:SqlDataSource>
    </asp:Panel>
    <asp:Panel ID="pnEditDetail" runat="server" Width="700px">
        <table width="100%" class="TableStyle" cellpadding="0" cellspacing="1">
            <tr>
                <td colspan="2" align="center">
                    <span class="BigLabel2" id="chiTietHoaDon">CHI TIẾT TIN</span>
                </td>
            </tr>
            <tr class="TrStyle">
                <td colspan="2" align="center">
                    <asp:Label runat="server" ID="lblId"></asp:Label>
                </td>
            </tr>
            <tr class="TrStyle">
                <td class="TdStyle" width="120" style="text-align: left">
                    Mục tin
                </td>
                <td class="TdStyle" style="text-align: left; width: 240px;">
                    <asp:DropDownList ID="cboNhomTin0" runat="server" AutoPostBack="True" 
                        DataTextField="Name" DataValueField="Id" Width="165px">
                        <asp:ListItem Text="- Tất cả -" Value="-1"></asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr class="TrStyle">
                <td class="TdStyle" style="text-align: left" width="120">
                    Trạng thái active
                </td>
                <td class="TdStyle" style="text-align: left; width: 240px;">
                    <asp:DropDownList ID="cboActive0" runat="server" DataTextField="Name" 
                        DataValueField="Id" Width="165px">
                        <asp:ListItem Text="- Tất cả -" Value="-1"></asp:ListItem>
                        <asp:ListItem Text="Active" Value="1"></asp:ListItem>
                        <asp:ListItem Text="Inactive" Value="0"></asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr class="TrStyle">
                <td style="height: 26px; text-align: left" width="120">
                    Title</td>
                <td style="height: 26px; text-align: left" width="120">
                    <asp:TextBox ID="txtTitle" runat="server" Width="600px"></asp:TextBox>
                </td>
            </tr>
             <tr class="TrStyle">
                <td style="height: 26px; text-align: left" width="120" class="style1">
                    SEO Title</td>
                <td style="height: 26px; text-align: left" width="120">
                    <asp:TextBox ID="txtSeoTitle" runat="server" Width="600px"></asp:TextBox>
                </td>
            </tr>
             <tr class="TrStyle">
                <td style="height: 26px; text-align: left" width="120" class="style1">
                    SEO Keywords</td>
                <td style="height: 26px; text-align: left" width="120">
                    <asp:TextBox ID="txtSeoKeywords" runat="server" Width="600px"></asp:TextBox>
                </td>
            </tr>
             <tr class="TrStyle">
                <td style="height: 26px; text-align: left" width="120" class="style1">
                    SEO Description</td>
                <td style="height: 26px; text-align: left" width="120">
                    <asp:TextBox ID="txtSeoDescription" runat="server" Width="600px"></asp:TextBox>
                </td>
            </tr>
            <tr class="TrStyle">
                <td style="height: 26px; text-align: left" width="120">
                    Tin hot</td>
                <td style="height: 26px; text-align: left" width="120">
                    <asp:CheckBox ID="chkHotSite" runat="server" Text="Là tin hot" />
                </td>
            </tr>
            <tr class="TrStyle">
                <td style="height: 26px; text-align: left" width="120">
                    Upload ảnh</td>
                <td style="height: 26px; text-align: left" width="120">
                    <asp:FileUpload ID="anh" runat="server" />
                    <asp:Button ID="cmdUpload" runat="server" Text="Upload" 
                        onclick="cmdUpload_Click" />
                </td>
            </tr>
            <tr class="TrStyle">
                <td style="height: 26px; text-align: left" width="120">
                    &nbsp;
                </td>
                <td style="height: 26px; text-align: left" width="120">
                    <asp:Label runat="server" ID="lblPathAnh" Visible="False"></asp:Label>
                    <asp:Image runat="server" ID="imgUpload"/>
                    <br/>
                    <br />
                    <asp:LinkButton runat="server" ID="cmdXoaAnh" Text="Xóa ảnh" 
                        OnClientClick="return confirm('Bạn có chắc muốn xóa?')"  Visible="False" 
                        onclick="cmdXoaAnh_Click"></asp:LinkButton>
                    <br />
                </td>
            </tr>
            <tr class="TrStyle">
                <td style="height: 34px; text-align: left" width="120">
                    Tóm lược
                </td>
                <td style="height: 34px; text-align: left">
                    <asp:TextBox ID="txtTomLuoc" runat="server" TextMode="MultiLine" Width="99%" Height="100px"></asp:TextBox>
                </td>
            </tr>
            <tr class="TrStyle">
                <td style="height: 34px; text-align: left" width="120">
                    Nội dung
                </td>
                <td style="height: 34px; text-align: left">
                    <FCKeditorV2:FCKeditor ID="fck" runat="server" BasePath="~/fckeditor/" Width="620px"
                        Height="600px">
                    </FCKeditorV2:FCKeditor>
                </td>
            </tr>
            <tr class="TrStyle">
                <td colspan="2" style="height: 26px; text-align: center">
                    <asp:Label ID="lblErrorChiTiet" runat="server" ForeColor="Red"></asp:Label>
                </td>
            </tr>
            <tr class="TrStyle">
                <td colspan="2" style="height: 26px; text-align: center">
                    <asp:Button ID="cmdCapNhatDetail" runat="server" 
                        Text="Cập nhật" onclick="cmdCapNhatDetail_Click" />
                    <asp:Button ID="cmdHuyBoDetail" runat="server" Text="Thoát" 
                        onclick="cmdHuyBoDetail_Click"  />
                </td>
            </tr>
        </table>
    </asp:Panel>
</center>
